<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib uri="http://config.com" prefix="config" %>
<!--Beyond Scripts-->
<script src="assets/js/toastr/toastr.js"></script>
<script src="assets/js/beyond.min.js"></script>
<link href="assets/js/customScrollbar/css/jquery.mCustomScrollbar.css" rel="stylesheet"/>
<script src="assets/js/customScrollbar/js/uncompressed/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="assets/js/websocket/socketjs/1.1.1/sockjs-1.1.1.js"></script>
<script type="text/javascript">
    setPageBodyHeight();
    var autoSetPageBodyHeightTimer = setInterval(function () {
        setPageBodyHeight();
        //菜单滚动条自动隐藏
        var sidebarmenus = $(".page-sidebar .sidebar-menus,.littleMenus");
        if (sidebarmenus.width() < 100) {
            sidebarmenus.removeClass("sidebar-menus").addClass("littleMenus");
        } else {
            sidebarmenus.addClass("sidebar-menus");
        }

    }, 100);

    function setPageBodyHeight() {
        try {
            var navbarHeight = $(".navbar");
            var pageBreadcrumbsHeight = $(".page-breadcrumbs");
            var pageHeaderHeight = $(".page-header");
            var mainFooterBarHeight = $("#mainFooterBar");
            var maxHeight = $(window).height()
                - (navbarHeight.height()
                    + pageBreadcrumbsHeight.height()
                    + pageHeaderHeight.height()
                    + mainFooterBarHeight.height());
            var sumExtraHeight = getPaddingAndMargin(navbarHeight)
                + getPaddingAndMargin(pageBreadcrumbsHeight)
                + getPaddingAndMargin(pageHeaderHeight)
                + getPaddingAndMargin(mainFooterBarHeight);
            var page_header_fixed = readCookie("page-header-fixed");
            var explorer = navigator.userAgent;
            if (page_header_fixed != "true") {
                //firefox
                if (explorer.indexOf("Firefox") >= 0) {
                    maxHeight += 30;
                }
                //Chrome
                else if (explorer.indexOf("Chrome") >= 0) {
                    maxHeight -= 40;
                } else {
                    $("html").css("overflow", "auto");
                    clearInterval(autoSetPageBodyHeightTimer);
                    return;
                }
            } else {
                //firefox
                if (explorer.indexOf("Firefox") >= 0) {
                    maxHeight += 0;
                }
                //Chrome
                else if (explorer.indexOf("Chrome") >= 0) {
                    maxHeight -= 110;
                } else {
                    $("html").css("overflow", "auto");
                    clearInterval(autoSetPageBodyHeightTimer);
                    return;
                }
            }
            maxHeight -= sumExtraHeight;
            var b0 = $("#checkbox_fixedbreadcrumbs").is(":checked");
            var b1 = $("#checkbox_fixedheader").is(":checked");
            var b2 = $("#checkbox_showheader").is(":checked");
            //firefox
            if (explorer.indexOf("Firefox") >= 0) {
                if (!b1 && !b2) {
                    maxHeight += 0;
                } else if (!b1 && b2) {
                    maxHeight += 0;
                } else if (b1 && b2) {
                    maxHeight += 0;
                } else if (b1 && !b2) {
                    maxHeight += 0;
                }
            }
            //Chrome
            else if (explorer.indexOf("Chrome") >= 0) {
                if (b0 && !b1 && !b2) {
                    maxHeight += 30;
                } else if (!b1 && b2) {
                    maxHeight += 0;
                } else if (b1 && b2) {
                    maxHeight += 0;
                } else if (b0 && b1 && !b2) {
                    maxHeight += 100;
                }
            }
            //$("body > div.main-container.container-fluid > div > div.page-content > div.page-breadcrumbs.breadcrumbs-fixed > ul > li.active").html(maxHeight+"  "+b0+"  "+b1+"  "+b2+"  "+$(".page-header").css("margin-top"));
            $(".page-body").css({
                "max-height": (maxHeight) + "px"
            });
            window.viewHeight = maxHeight;
        } catch (e) {
        }
    }

    function getPaddingAndMargin($ele) {
        try {
            var marginTop = $ele.css("margin-top");
            var marginBottom = $ele.css("margin-bottom");
            var paddingTop = $ele.css("padding-top");
            var paddingBottom = $ele.css("padding-bottom");
            var extraHeight = 0;
            if (marginTop) {
                extraHeight += parseInt(marginTop.toString().split("px")[0]);
            }
            if (marginBottom) {
                extraHeight += parseInt(marginBottom.toString().split("px")[0]);
            }
            if (paddingTop) {
                extraHeight += parseInt(paddingTop.toString().split("px")[0]);
            }
            if (paddingBottom) {
                extraHeight += parseInt(paddingBottom.toString().split("px")[0]);
            }
            return extraHeight;
        } catch (e) {
        }
    }
</script>
<center>
	<div class="footer " id="mainFooterBar">
		<div class="footer-inner">Copyright &copy;<config:getConfigValue key="platformCopyright"/>版权所有.</div>
	</div>
</center>
<script>
    initWebSocket(window.location.host);
</script>
<!-- END FOOTER -->